<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<div id="container">

    <p>{{ message }}</p>

    <button v-on:[event]="reverseMessage">Reverse</button>
</div>

<script src="https://unpkg.com/vue@next"></script>
<script type="text/javascript">

    const demoApp = {
        data() {
            return {
                event: 'click',
                message: 'hello world'
            }
        },
        methods: { // 初学者此处容易出错，与data()混淆
            reverseMessage() {
                this.message = this.message.split(' ').reverse().join() //容易出错的地方，反转后没有赋值给message
            }
        }
    }

    Vue.createApp(demoApp).mount('#container')
</script>

</body>
</html>
